﻿using Abp.Domain.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yozeev.UserManagerment.Users;

namespace Yozeev.Controllers.Stats.Filters
{
    public class CheckerFilter : AbstractFilter
    {
        private readonly IRepository<User, long> _userRep;

        public CheckerFilter(IRepository<User, long> userRep)
        {
            _userRep = userRep;
        }

        public override void Decorate(Dictionary<string, IEnumerable<object>> Data)
        {
            if (Data.ContainsKey("Checkers")) return;
            // TODO: 根据角色查询操作员
            var users = _userRep.GetAll();
            Data.Add("Checkers", users.ToList());
        }
    }
}
